# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=opencl-icd-loader
_pkgreal=ocl-icd
pkgver=2.2.12
pkgrel=4
pkgdesc="Generic OpenCL ICD Loader"
url="https://github.com/OCL-dev/ocl-icd"
arch="all"
license="custom"
depends_dev="$pkgname"
makedepends="ruby libtool autoconf automake"
subpackages="$pkgname-doc $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/OCL-dev/ocl-icd/archive/v$pkgver.tar.gz
	ocl_icd_loader.c.patch"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -D -m644 COPYING "$pkgdir"/usr/share/doc/ocl-icd/LICENSE
}

sha512sums="f1668c3a39ecfbc089ee5a5f61f44ceb86ab80e504e58064dec306ce907daf77936c5403b4af15ed8714068891d68346c86725f285cfbc90c4fcb35d18db4048  opencl-icd-loader-2.2.12.tar.gz
7857997fdc03ba9db7a7acd25706d8616b3037f0f1aca03cab652be593475a498c7f04b42cdecf08daafdfb8de4684181e4a1389707b898b78797a88779c162b  ocl_icd_loader.c.patch"
